package com.api.shopapi.service.impl;

import com.api.shopapi.entity.QZXuetangyi;
import com.api.shopapi.mapper.QZXuetangyiMapper;
import com.api.shopapi.service.QZXuetangyiService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("QZXuetangyiServiceImplOne")
public class QZXuetangyiServiceImpl implements QZXuetangyiService {

    @Autowired
    private QZXuetangyiMapper qzXuetangyiMapper;

    @Override
    public int insert(QZXuetangyi qzXuetangyi) {
        return qzXuetangyiMapper.insert(qzXuetangyi);
    }

    @Override
    public PageInfo<QZXuetangyi> getPageByDevicesn(int pageIndex, int pageSize, String sn) {
        PageHelper.startPage(pageIndex,pageSize);
        List<QZXuetangyi> qzXuetangyiList = qzXuetangyiMapper.getPageByDevicesn(sn);
        return new PageInfo<>(qzXuetangyiList);
    }
}
